#include "test.h"

int main()
{
    int shmid = CreatShm();
    struct shmid_ds d;
    char* shm = (char*)AttackShm(shmid);

    while(true)
    {
        char str[4096] = {0};
        char *s = fgets(str,sizeof(str),stdin);
        (void*)s;
        str[strlen(str)-1]=0;
        snprintf(shm,sizeof(str),"%s",str);
        sleep(1);
        if(strcmp(str,"quit") == 0) break;
    }

    UnLinkShm(shm);
    DelShm(shmid);
    return 0;
}